package cn.lx.expansion.dynamic2;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author lixin
 * @Classname MyInvocationHandler
 * @Description TODO
 * @Date 2019/10/5 下午4:03
 */
public class MyInvocationHandler implements InvocationHandler {

    // 被代理的对象
    private Object target = null;

    // 通过构造方法传送一个对象
    public MyInvocationHandler(Object _obj) {
        this.target = _obj;
    }

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        return method.invoke(this.target, args);
    }
}
